﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using CommunitySystem.Model;
using System.Collections.ObjectModel;
using CommunitySystemModel;


namespace CommunitySystem.Web.Service
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IDataService" in both code and config file together.
    [ServiceContract]
    public interface IDataService
    {
        #region 数据字典
        [OperationContract]
        IList<DictionaryModel> GetDictionaryModels(string parentId);
        [OperationContract]
        IList<DictionaryModel> GetDictionaryModels1(string parentId);
        [OperationContract]
        IList<DictionaryModel> GetDictionarys();
        [OperationContract] 
        DictionaryModel GetDictionaryByCode(string dictCode);
        [OperationContract]
        int InsertDictionary(List<DictionaryModel> model);


        [OperationContract]
        DataDictionaryModel GetDictModel(string DictCode, string parameter);
        #endregion


        #region 菜单管理
        [OperationContract]
        ObservableCollection<MenuItem> GetMenuByContidtion(string condition);

        [OperationContract]
        ObservableCollection<MenuItem> GetMenuByPID(int pid);

        [OperationContract]
        void AddMenuItem(MenuItem item);

        [OperationContract]
        void UpdateMenuItem(MenuItem item);

        [OperationContract]
        void DeleteMenuItem(int id);

        [OperationContract]
        MenuItem ValidateIsDefault(MenuItem mi);

        

        [OperationContract]
        ObservableCollection<MenuItem> GetSubMenuByUserID(int userid, int topid);

        [OperationContract]
        ObservableCollection<MenuItem> GetSubMenuByUserIDByRole(int userid, int topid, int role);
        #endregion
    }
}
